<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background-color: brown;
    }
  </style>
</head>

<body>
  <button>半透明fadeTo</button>
  <button>隐藏fadeOut</button>
  <button>显示fadeIn</button>
  <div></div>

  <script src="./js/jquery-3.6.0.js"></script>
  <script>
    $('button').eq(0).on('click', function () {
      $('div').fadeTo(1000, 0.5)
    })

    $('button').eq(1).on('click', function () {
      $('div').fadeOut(1000)
    })

    $('button').eq(2).on('click', function () {
      $('div').fadeIn(1000)
    })
  </script>
</body>

</html>